package com.example.keymanagertwo.Adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.keymanagertwo.Bean.Bean;
import com.example.keymanagertwo.R;

import java.util.List;

public class keyadapter extends BaseAdapter{
    private List<Bean> list;
    private vhvhvh vh;



        public keyadapter(List<Bean> list) {


        this.list = list;
    }






    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {


if(view == null){
    view= LayoutInflater.from(viewGroup.getContext())
            .inflate(R.layout.listview,viewGroup,false);
        vh = new vhvhvh();
        vh.t1=view.findViewById(R.id.tv1);
        vh.t2=view.findViewById(R.id.tv2);
        vh.t3=view.findViewById(R.id.tv3);
        view.setTag(vh);

}else{
    vh= (vhvhvh) view.getTag();
}
             Bean be = list.get(i);
             vh.t1.setText(be.getAddress());
             vh.t2.setText(be.getRomm());
             vh.t3.setText(be.getData());





        return view;

    }
    class vhvhvh{
        TextView t1,t2,t3;


    }
}
